#include <iostream>

using namespace std;

class Shape    //基类
{
public :
    void setWidth(int w);
    void setHeight(int h);

protected:
    int width;
    int height;
};

void Shape::setHeight(int h)
{
    height = h;
}

void Shape::setWidth(int w)
{
    width = w;
}

class PaintCost
{
public :
    int getCost(int area);

};

int PaintCost::getCost(int area)
{
    return area * 70;
}

class Rectangle : public Shape, public PaintCost
{
public:
    int getArea();
};

int Rectangle::getArea()
{
    return (width * height);
}

int main(void)
{
    Rectangle Rect;

    int area;

    Rect.setWidth(5);
    Rect.setHeight(7);

    area = Rect.getArea();

    cout << " Total area :" << Rect.getArea() << endl;
    cout << " Total paint cost : " << Rect.getCost(area) << endl;

    return 0;
}
